#!/bin/sh
npx --no-install commitlint --edit $1
msg=$(grep -iE '((--bug=|--story=|--test=|--task=)[0-9]{1,})|build: |Merge)' .git/COMMIT_EDITMSG)
if [ -z $msg ];
then
  echo
  echo '缺失关键字：--bug=tapdId  or --story=tapdId or --test= testId or --task=tapdId'
  echo
  # cat .git/COMMIT_EDITMSG
  exit 1
fi